<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>退换货详情-{{$SEO['title']}}</title>
    <meta name="keywords" content="{{$SEO['keywords']}}"/>
    <meta name="description" content="{{$SEO['description']}}"/>

    <!--公用css引用-->
    @include('front.common.style')
    <!--END/公用css引用-->
    <link rel="stylesheet" href="{{ URL::asset('/') }}css/userCenter.css">

</head>
<body>

<!--公共头部-->
@include('front.common.header')
<!--END/公共头部-->
@if(!$refund_goods)
    退货商品不存在，请检查错误
@endif
@inject('refundGoodsOperationRecordService','App\Interfaces\RefundGoodsOperationRecordService')
@inject('userService','App\Interfaces\UserService')

<?php
        $refundGoodsOperationRecord = $refundGoodsOperationRecordService->getByRefundSn($refund_goods->refund_sn);

        $refund_sn = $refund_goods->refund_sn;


?>
<div class="inbox user-center">
    <div class="layout-margin unend">
        <div class="sidebar-end"></div>
        <div class="sidebar-start">
            @include('front.common.leftnav')
        </div>

        <!--主体部分-->
        <div class="container">
            <div class="container-inner return-detail">
                <div class="tit">
                    <div class="h"><strong>申请服务详情</strong></div>
                    <a href="" class="text-color-8  more">售后政策</a>
                </div>
                <div class="bl-alert alert-warning fn-mt10">
                    <span class="font-16 text-color-7">本次售后服务由 <span class="text-color-1">阿福易购</span> 为您提供</span>

                    <span class="text-color-7 fn-ml20">售后服务单号：{{$refund_goods->refund_sn}}  </span>

                </div>

                <div class="tit fn-mt20">
                    <div class="h"><strong>售后信息</strong></div>
                </div>

                <div class="ui-box">
                    <div class="inbox step-by-step pay-back-step">
                        <div class="gray-line"></div>
                        <div class="success-line" style="width: 100%;"></div>
                        <div class="before-line" style="width: 100%;"></div>
                        <ul class="step-list ui-cols-4">
                            <li class="step col step-before">
                                <i class="icon icon-step">1</i>
                                <div class="txt">提交申请</div>
                            </li>
                            <li class="step col @if($refund_goods->refund_status==1) step-cur @else step-before @endif">
                                <i class="icon icon-step">2</i>
                                <div class="txt @if($refund_goods->refund_status==3) step-cur @endif">后台审核</div>
                            </li>
                            @if($refund_goods->refund_status==4)

                                <li class="step col step-before">
                                    <i class="icon icon-step">3</i>
                                    <div class="txt @if($refund_goods->refund_status==3) step-cur @endif">审核不通过</div>
                                </li>
                                <li class="step col step-cur">
                                    <i class="icon icon-step">4</i>
                                    <div class="txt @if($refund_goods->refund_status==3) step-cur @endif">结束</div>
                                </li>
                            @else
                            <li class="step col @if($refund_goods->refund_status==2) step-cur @else step-before @endif">
                                <i class="icon icon-step">3</i>
                                <div class="txt @if($refund_goods->refund_status==3) step-cur @endif">退货处理</div>
                            </li>
                            <li class="step col @if($refund_goods->refund_status==3) step-cur @else step-before @endif">
                                <i class="icon icon-step">4</i>
                                <div class="txt @if($refund_goods->refund_status==3) step-cur @endif">退货完成</div>
                            </li>
                            @endif

                        </ul>
                    </div>
                </div>

                <div id="opWrap" class="ui-brd-box1 option-status">
                    <div class="inner">
                        <div class="fn-rel">
                            <div class="fn-abs op-type">处理环节</div>
                            <div class="fn-abs line"></div>
                            <div class="fn-abs yuan"></div>
                            <ul class="op-list">

                                @foreach($refundGoodsOperationRecord as $key=>$item)
                                    <?php
                                        if($refundGoodsOperationRecord->count()==($key+1)){
                                            $last_status = $item->operation_status;
                                        }
                                    ?>

                                    @if($item->operation_status==1)
                                    <li>
                                        <strong>处理信息：</strong>
                                        <br>
                                        <span class="text-color-7">服务单【{{trim($item->refund_sn)}}】创建成功,等待管理员审核</span>
                                        <p class="fn-mt10">操作人：
                                            @if($item->user_id==0)
                                                系统
                                            @else
                                                {{$userService->getUser($item->user_id)->user_name}}
                                            @endif
                                            【{{$item->operation_time}}】 </p>
                                    </li>
                                    @endif
                                    @if($item->operation_status==2)
                                        <li>
                                            <strong>处理信息：</strong>
                                            <br>
                                            <span class="text-color-7">审核通过</span>
                                            <p class="fn-mt10">操作人：
                                                @if($item->user_id==0)
                                                    系统
                                                @else
                                                    {{$userService->getUser($item->user_id)->user_name}}
                                                @endif
                                                【{{$item->operation_time}}】 </p>
                                        </li>
                                    @endif
                                    @if($item->operation_status==3)
                                        <li>
                                            <strong>处理信息：</strong>
                                            <br>
                                            <span class="text-color-7">处理完毕</span>
                                            <p class="fn-mt10">操作人：
                                                @if($item->user_id==0)
                                                    系统
                                                @else
                                                    {{$userService->getUser($item->user_id)->user_name}}
                                                @endif
                                                【{{$item->operation_time}}】 </p>
                                        </li>
                                    @endif
                                    @if($item->operation_status==4)
                                        <li>
                                            <strong>处理信息：</strong>
                                            <br>
                                            <span class="text-color-7">不予受理</span>
                                            <p class="fn-mt10">操作人：
                                                @if($item->user_id==0)
                                                    系统
                                                @else
                                                    {{$userService->getUser($item->user_id)->user_name}}
                                                @endif
                                                【{{$item->operation_time}}】 </p>
                                        </li>
                                    @endif
                                    @if($item->operation_status==5)
                                        <li>
                                            <strong>处理信息：</strong>
                                            <br>
                                            <span class="text-color-7">已取消</span>
                                            <p class="fn-mt10">操作人：
                                                @if($item->user_id==0)
                                                    系统
                                                @else
                                                    {{$userService->getUser($item->user_id)->user_name}}
                                                @endif
                                                【{{$item->operation_time}}】 </p>
                                        </li>
                                    @endif
                                @endforeach
                            </ul>
                        </div>

                        {{--<div class="fn-rel fn-mt20">
                            <div class="fn-abs op-type">审核环节</div>
                            <div class="fn-abs line"></div>
                            <div class="fn-abs yuan"></div>
                            <ul class="op-list">
                                <li>
                                    <strong>处理信息：</strong>
                                    <br>
                                    <span class="text-color-7">您的服务单155460684的商品已收到</span>
                                    <p class="fn-mt10">操作人：System (2015-04-13 18:58:28)</p>
                                </li>
                                <li>
                                    <strong>处理信息：</strong>
                                    <br>
                                    <span class="text-color-7">财务已审核,银行退款中</span>
                                    <p class="fn-mt10">操作人：系统 (2015-04-14 09:25:04)</p>
                                </li>
                                <li>
                                    <strong>处理信息：</strong>
                                    <br>
                                    <span class="text-color-7">您的服务单已审核客户发货，请将商品寄回</span>
                                    <p class="fn-mt10">操作人：申长伟 (2015-04-13 18:58:22)</p>
                                </li>
                                <li>
                                    <strong>处理信息：</strong>
                                    <br>
                                    <span class="text-color-7">您的服务单已申请成功，待售后审核中</span>
                                    <p class="fn-mt10">操作人：系统 (2015-04-13 16:31:59)</p>
                                </li>
                            </ul>
                        </div>--}}

                    </div>

                    <a href="javascript:;" class="fn-abs btn-more js-more text-color-8 off">查看更多</a>
                </div>


                <div class="tit fn-mt20">
                    <div class="h"><strong>服务单信息</strong></div>
                </div>

                <div class="fn-mt10">
                    <ul class="comments">
                        <!-- <li>
                            <span class="fn-dib label">退款方式</span>
                            <div class="fn-dib fn-mr20">
                                账户余额：7.00 (元)
                                <br>
                                网银pos刷卡 :28.00 (元)
                            </div>

                            <a href="" class="text-color-8 fn-mr10">查看账户余额</a>
                            <a href="" class="text-color-8">退款明细</a>
                        </li>-->
                        @if($last_status==3)
                        <li>
                            <div class="fn-dib label fn-fl">商品处理方式</div>
                            <div class="text-color-0 fn-ohide">客户期望处理方式为“退货” ，最终处理方式为“退货”</div>
                        </li>
                        @endif
                        <li>
                            <div class="fn-dib label fn-fl">退款原因</div>
                            <div class="text-color-0 fn-ohide">{{$refund_goods->reason}}</div>
                        </li>
                        <li>
                            <div class="fn-dib label fn-fl">退款金额</div>

                            <div class="text-color-0 fn-ohide">


                            @if($refund_goods->goods_real_price > 0)
                                <?php echo sprintf("%.2f",substr(sprintf("%.3f", $refund_goods->goods_real_price*$refund_goods->number - $refund_goods->coupon_price_offset), 0, -1)); ?>
                            @else
                                <?php echo sprintf("%.2f",substr(sprintf("%.3f", $refund_goods->shop_price*$refund_goods->number - $refund_goods->coupon_price_offset), 0, -1)); ?>
                            @endif
                                 元</div>

                        </li>
                        <li>
                            <div class="fn-dib label fn-fl">联系信息</div>
                            <div class="text-color-0 fn-ohide">联系人：{{$refund_goods->real_name}} <span class="w-4em">&nbsp;</span>手机：{{$refund_goods->phone}}</div>
                        </li>
                        {{--<li class="sum">
                            账户余额： ￥7.00<br>
                            网银pos刷卡 ￥28.00<br>
                            <strong>退款总额： <span class="text-color-1 font-14">￥35.00</span></strong>
                        </li>--}}
                    </ul>
                </div>
            </div>
        </div>
        <!--END/主体部分-->

    </div>
</div>

<!--公共尾部-->
@include('front.common.footer')
<!--END/公共尾部-->

<!--公用js引用-->
@include('front.common.script')
<!--END/公用js引用-->
<script>
    $('#opWrap').on('click','.js-more',function(){
        var that=$(this),pObj=that.prev('.inner');
        that.toggleClass('off');
        if(that.hasClass('off')){
            pObj.css('height','90px');
            that.text('查看更多');
        }else {
            pObj.css('height','auto');
            that.text('收起');
        }

    });
</script>
</body>
</html>